Skip to content

State improvements#663

Open
techniq wants to merge 1055 commits intonextfrom
state-refactor
Open

State improvements#663
techniq wants to merge 1055 commits intonextfrom
state-refactor

Conversation

@techniq
Copy link
Copy Markdown
Owner

@techniq techniq commented Oct 19, 2025

Goals

  • Integrate simplified charts
    • snippets / default impl
    • simplified setup
    • series state
  • External control / sync
    • Set initial highlightSeriesKey
    • Save/restore state to localStorage / query string / etc
  • Improve tooltip data (multi-series with/without data, etc)
    • currently expose tooltipState.data and tooltipState.payload
  • Data-driven primitives / marks
  • Image mark

  • Chart
    • Add series prop
    • Add orientation to Chart (if needed)?
      • Added valueAxis due to inverted orientation meaning in LineChart/BarChart
  • ChartState / context
    • Expose seriesState on context
    • Simplify HighlightKey
  • Rename ChartState geoContext / brushContext / tooltipContext to geoState / etc
  • Rename <GeoContext bind:geoContext> to <GeoContext bind:state> (and BrushContext, TooltipContext, TransformContext)
  • Instantiate GeoState etc within Chart / ChartState?
    • Replace getGeoContext with getChartContext and use ctx.geo
      • Useful to keep getGeoContext for overrides such as a translucent globe
    • Do we need GeoContext / etc? (if it doesn't have any pointer events / elements)
      • Only when overriding (not within Chart. Simplified and renamed GeoContext to GeoProjection
    • Move $effect()logic in GeoContext to GeoState
  • Fix <BarChart seriesLayout="group"> regression (before this PR)
  • Remove createLegendProps() and handle directly since ctx.seriesState is available
  • Update ChartAnnotations to use ctx.seriesState
  • Update DefaultTooltip to use ctx.seriesState
  • GeoDebug usage
  • TransformDebug usage
  • GeoTile performance (local-only?)
  • Should TransformState handle pointer events onPointerMove, etc or within TransformContext
  • Rename tooltipContext props (Arc, GeoPath, etc) to tooltipState (or just tooltip)?
  • Remove tooltipMetaContext (consolidate payload, etc)
  • Bounds use case integration (reference)

Verify


To fix

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Oct 19, 2025

🦋 Changeset detected

Latest commit: 0e8f99d

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@techniq techniq changed the base branch from main to docs-v2 October 19, 2025 18:44
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 19, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
layerchart ✅ Ready (View Log) Visit Preview 0e8f99d

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Oct 19, 2025

Open in StackBlitz

npm i https://pkg.pr.new/layerchart@663

commit: 0e8f99d

This was referenced Oct 23, 2025
techniq added 30 commits March 26, 2026 23:33
…ring `cRange`. Simplify LineChart/gradient-encoding example
… scales

Bar now automatically derives `initialY`/`initialHeight` (vertical) or `initialX`/`initialWidth` (horizontal) from the chart's scale range when `motion` is configured, removing the need to hardcode pixel values.

Also improves `valueAxis` inference on `ChartState` — when not explicitly set, it is now derived from scale types (band scale on y → `valueAxis: 'x'`, band scale on x → `valueAxis: 'y'`).
…ded bars starting below the baseline during mount animation
…ction mode (and scale images/etc based on zoom)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment